#pragma once
#include "type.h"
#ifndef MYSQL_TYPE_H
#define MYSQL_TYPE_H
typedef enum mysql_type {
	MYSQL_TYPE_DECIMAL=0x00,
	MYSQL_TYPE_TINY=0x01,
	MYSQL_TYPE_SHORT=0x02,
	MYSQL_TYPE_LONG=0x03,
	MYSQL_TYPE_FLOAT=0x04,
	MYSQL_TYPE_DOUBLE=0x05,
	MYSQL_TYPE_NULL=0x06,
	MYSQL_TYPE_TIMESTAMP=0x07,
	MYSQL_TYPE_LONGLONG=0x08,
	MYSQL_TYPE_INT24=0x09,
	MYSQL_TYPE_DATE=0x0a,
	MYSQL_TYPE_TIME=0x0b,
	MYSQL_TYPE_DATETIME=0x0c,
	MYSQL_TYPE_YEAR=0x0d,
	MYSQL_TYPE_NEWDATE=0x0e,
	MYSQL_TYPE_VARCHAR=0x0f,
	MYSQL_TYPE_BIT=0x10,
	MYSQL_TYPE_TIMESTAMP2=0x11,
	MYSQL_TYPE_DATETIME2=0x12,
	MYSQL_TYPE_TIME2=0x13,
	MYSQL_TYPE_NEWDECIMAL=0xf6,
	MYSQL_TYPE_ENUM=0xf7,
	MYSQL_TYPE_SET=0xf8,
	MYSQL_TYPE_TINY_BLOB=0xf9,
	MYSQL_TYPE_MEDIUM_BLOB=0xfa,
	MYSQL_TYPE_LONG_BLOB=0xfb,
	MYSQL_TYPE_BLOB=0xfc,
	MYSQL_TYPE_VAR_STRING=0xfd,
	MYSQL_TYPE_STRING=0xfe,
	MYSQL_TYPE_GEOMETRY=0xff
}MYSQL_TYPE;

static U_WORD type_chang_to_name(MYSQL_TYPE mysqltype) {
	switch (mysqltype)
	{
	case MYSQL_TYPE_DECIMAL:
		return 0x02;
		break;
	case MYSQL_TYPE_TINY:
		return 0x00;
		break;
	case MYSQL_TYPE_SHORT:
		return 0x00;
		break;
	case MYSQL_TYPE_LONG:
		return 0x00;
		break;
	case MYSQL_TYPE_FLOAT:
		return 0x01;
		break;
	case MYSQL_TYPE_DOUBLE:
		return 0x01;
		break;
	case MYSQL_TYPE_NULL:
		return 0x00;
		break;
	case MYSQL_TYPE_TIMESTAMP:
		return 0x00;
		break;
		
	case MYSQL_TYPE_LONGLONG:
		return 0x00;
		break;
	case MYSQL_TYPE_INT24:
		return 0x00;
		break;
	case MYSQL_TYPE_DATE:
		return 0x00;
		break;
	case MYSQL_TYPE_TIME:
		return 0x00;
		break;
	case MYSQL_TYPE_DATETIME:
		return 0x00;
		break;
	case MYSQL_TYPE_YEAR:
		return 0x00;
		break;
	case MYSQL_TYPE_NEWDATE:
		return 0x00;
		break;
	case MYSQL_TYPE_VARCHAR:
		return 0x02;
		break;
	case MYSQL_TYPE_BIT:
		return 0x00;
		break;
	case MYSQL_TYPE_TIMESTAMP2:
		return 0x00;
		break;
	case MYSQL_TYPE_DATETIME2:
		return 0x00;
		break;
	case MYSQL_TYPE_TIME2:
		return 0x00;
		break;
	case MYSQL_TYPE_NEWDECIMAL:
		return 0x02;
		break;
	case MYSQL_TYPE_ENUM:
		return 0x02;
		break;
	case MYSQL_TYPE_SET:
		return 0x00;
		break;
	case MYSQL_TYPE_TINY_BLOB:
		return 0x00;
		break;
	case MYSQL_TYPE_MEDIUM_BLOB:
		return 0x00;
		break;
	case MYSQL_TYPE_LONG_BLOB:
		return 0x00;
		break;
	case MYSQL_TYPE_BLOB:
		return 0x01;
		break;
	case MYSQL_TYPE_VAR_STRING:
		return 0x02;
		break;
	case MYSQL_TYPE_STRING:
		return 0x02;
		break;
	case MYSQL_TYPE_GEOMETRY:
		return 0x00;
		break;
	default:
		break;
	}
}
#endif // !MYSQL_TYPE_H
